/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chapter4;

/**
 *
 * @author Denise Carolina
 */
public class Examples {
      /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int x = 0;

        x = (x++) + 5;
        System.out.println("x=" + x);
        int y = 0;
        x += y++ + 5;
        System.out.println("x=" + x + " y=" + y);

        System.out.println("char 'a' == 'a' ? " + ('a' == 'a'));
        System.out.println("char 'a' == 'b' ? " + ('a' == 'b'));
        System.out.println("5 != 6 ? " + (5 != 6));
        System.out.println("5.0 == 5L? " + (5.0 == 5L));
        System.out.println("true == false? " + (true == false));

        boolean b = false;
        if (b = true){ System.out.println("b is strue");}
        else {System.out.println(" b is false");}

        int xy = 1;
//        if (xy = 0){}
        if (xy == 0){}

        int sizeOfYard = 10;
        int petCount = 3;
        String status = (petCount < 4)? "pet count OK" : (sizeOfYard > 8) ? "pet limit on edge" : "too many pets";
        System.out.println("status:: " + status);

        A a = new A();
        System.out.println("A instanceof B? " + (a instanceof B));
    }
 static interface B{}
 static class A implements B{};

    @Override
    protected void finalize() throws Throwable {
        System.out.println("run finalize()");
        super.finalize();
    }


}
 
